package ninth.线程操作案例.问题解决1_加入同步;

  class Consumer1 implements Runnable {
    private Info info;

    public Consumer1(Info info) {
        this.info = info;
    }

    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            this.info.get();    //取出信息
        }
    }
}

public class 修改消费者 {
}
